package com.lzh.seatrend.common.constant;

public enum  ResultCode {

    /*---- START 基础code ----*/
    //操作成功
    SUCCESS(true,0,"base.success"),
    //操作失败
    FAIL(false,1,"base.fail"),
    //域为空
    VALIDAT_FAILED(false,2,"domain.is.empty");
    /*---- END 基础code ----*/

    /*---- ***模块 code ----*/
    /*....未完待续*/

    private boolean status;
    private int code;
    private String msg;

    ResultCode() {
    }

    ResultCode(boolean status, int code, String msg) {
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public ResultCode setMsg(String msg){
        this.msg = msg;
        return this;
    }

//    public static void main(String[] args) {
//        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
//        messageSource.setBasenames("messages","code");
//        messageSource.setAlwaysUseMessageFormat(true);
//        MessageUtil messageUtil = new MessageUtil(messageSource);
//        String code = messageUtil.getDefaultMessage("base.success");
//        System.out.println(code);
//    }
}
